<template>
  <el-dialog
    title="成交信息"
    :visible="isShowObjectInfo"
    width="50%"
    @close="dialogClose"
  >
  <el-form :model="ruleForm" :rules="rules" ref="infoForm" label-width="100px">
    <el-row :gutter="24">
        <el-col :span="12">
            <el-form-item label="佣金(元)" prop="commission">
                <el-input v-model="ruleForm.commission"></el-input>
            </el-form-item>
        </el-col>
    </el-row>

    <el-row :gutter="24">
        <el-col :span="12">
            <el-form-item label="证件号码" prop="certificateNum">
                <el-input v-model="ruleForm.certificateNum"></el-input>
            </el-form-item>
        </el-col>
        <el-col :span="10">
            <el-form-item label="证件类型" prop="certificateType">
                <el-select v-model="ruleForm.certificateType"></el-select>
            </el-form-item>
        </el-col>
    </el-row>

    <el-row :gutter="24">
        <el-col :span="12">
            <el-form-item label="竞买人姓名" prop="buyerName">
                <el-input v-model="ruleForm.buyerName"></el-input>
            </el-form-item>
        </el-col>
        <el-col :span="10">
            <el-form-item label="竞买人号牌" prop="buyerNum">
                <el-input v-model="ruleForm.buyerNum"></el-input>
            </el-form-item>
        </el-col>
    </el-row>

    <el-row :gutter="24">
        <el-col :span="22">
            <el-form-item label="备注" prop="remark">
                <el-input type="textarea" v-model="ruleForm.remark"></el-input>
            </el-form-item>
        </el-col>
    </el-row>

  </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogClose">取 消</el-button>
      <el-button type="primary" @click="submitData">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
    data(){
        return{
            ruleForm: {
                commission: '',
                certificateNum: '',
                certificateType: '',
                buyerName: '',
                buyerNum: '',
                remark: ''
            },
            rules:{
                commission:[
                    {required: true, message: '请输入'}
                ],
                certificateNum:[
                    {required: true, message: '请输入'}
                ],
                certificateType:[
                    {required: true, message: '请选择'}
                ],
                buyerName:[
                    {required: true, message: '请输入'}
                ],
                buyerNum:[
                    {required: true, message: '请输入'}
                ],
                remark:[
                    {required: false}
                ],
            }
        }
    },
    props: {
        isShowObjectInfo: {
            type: Boolean,
        },
    },
    methods: {
        dialogClose() {
            this.$emit("dialogClose");
        },
        submitData(){
            this.$refs.infoForm.validate((valid) => {
                if (!valid) {
                    return ;
                }
                else {
                    this.$emit('dialogClose');
                }
            });
          },
    },
};
</script>

<style>

</style>